//package cn.net.shuxing.yifu.common.quartz.job;
//
//import cn.net.shuxing.yifu.common.bean.*;
//import cn.net.shuxing.yifu.common.constant.*;
//import cn.net.shuxing.yifu.common.dto.BaseDto;
//import cn.net.shuxing.yifu.common.front.controller.DealController;
//import cn.net.shuxing.yifu.common.service.*;
//import cn.net.shuxing.yifu.common.util.JedisUtil;
//import cn.net.shuxing.yifu.common.util.LocalDateTimeUtil;
//import cn.net.shuxing.yifu.common.util.MarkImageUtil;
//import cn.net.shuxing.yifu.common.util.RedisKeyCreator;
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.InitializingBean;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//import org.springframework.util.Base64Utils;
//import org.springframework.util.ObjectUtils;
//import cn.net.shuxing.yifu.common.util.StringUtils;
//import redis.clients.jedis.Jedis;
//
//import javax.imageio.ImageIO;
//import java.awt.image.BufferedImage;
//import java.io.IOException;
//import java.time.LocalDate;
//import java.time.LocalDateTime;
//import java.util.*;
//
//
//@Component
//@Slf4j
//public class Task {
//
//    @Autowired
//    private DealHistoryService dealHistoryService;
//
//    @Autowired
//    private JedisUtil jedisUtil;
//
//    @Autowired
//    private CoinTypeService coinTypeService;
//
//    @Autowired
//    private UserService userService;
//
//    @Autowired
//    private DealParamService dealParamService;
//
//    @Autowired
//    private UserWalletFrozeService userWalletFrozeService;
//
//    @Autowired
//    private AliveCoinActivateHistoryService aliveCoinActivateHistoryService;
//
//    @Autowired
//    private UserCommonService userCommonService;
//
//    @Autowired
//    ShareholderCommonService shareholderCommonService;
//
//    @Autowired
//    ShareholderCoinGrantHistoryService shareholderCoinGrantHistoryService;
//
//    @Autowired
//    DealMatchService dealMatchService;
//
//    @Autowired
//    DealController dealController;
//
//    @Autowired
//    OssCommonService ossCommonService;
//
//    @Autowired
//    UserRealInfoService userRealInfoService;
//
////    //    @Scheduled(cron = "0 0 0 * * ?")
////    @Scheduled(fixedRate = 5 * 60 * 1000)
////    public void checkUserPublishable()
////    {
////        List<User> userList = userService.getAll();
////        for (User user : userList)
////        {
////            if (!userService.hasRole(user.getId(),UserType.MEMBER))
////                continue;
////            else
////            {
////                BaseDto myOnlineDeal = dealController.getMyOnlineDeal(user.getId(), DealType.HANG_BUY);
////                if (myOnlineDeal != null && !myOnlineDeal.isError())
////                {
////                    if (myOnlineDeal.getData() != null)
////                    {
////                        /** 有在线挂买单 **/
////                        //Jedis //jedis = jedisUtil.getJedis();
////                        jedisUtil.set(RedisKeyCreator.ablePublishHangBuy(user.getId()),"1");
////                        //jedisUtil.close();
////                    }
////                    else
////                    {
////                        /** 没有在线挂买单 **/
////                        //Jedis //jedis = jedisUtil.getJedis();
////                        jedisUtil.del(RedisKeyCreator.ablePublishHangBuy(user.getId()));
////                        //jedisUtil.close();
////                    }
////                }
////
////                myOnlineDeal = dealController.getMyOnlineDeal(user.getId(), DealType.HANG_SALE);
////                if (myOnlineDeal != null && !myOnlineDeal.isError())
////                {
////                    if (myOnlineDeal.getData() != null)
////                    {
////                        /** 有在线挂卖单 **/
////                        //Jedis //jedis = jedisUtil.getJedis();
////                        jedisUtil.set(RedisKeyCreator.ablePublishHangSale(user.getId()),"1");
////                        //jedisUtil.close();
////                    }
////                    else
////                    {
////                        /** 没有在线挂卖单 **/
////                        //Jedis //jedis = jedisUtil.getJedis();
////                        jedisUtil.del(RedisKeyCreator.ablePublishHangSale(user.getId()));
////                        //jedisUtil.close();
////                    }
////                }
////            }
////        }
////    }
//
//        /** 实名认证 **/
//    @Scheduled(fixedRate = 5 * 60000)
//    public void trueInfoVetrify()
//    {
//        List<UserRealInfo> userRealInfoList = userRealInfoService.getAllNeedVerify();
//        if (userRealInfoList != null)
//        {
//            for (UserRealInfo userRealInfo : userRealInfoList)
//            {
//                /** 验证正面照 **/
//                String idCardFrontPhoto = userRealInfo.getIdCardFrontPhoto();
//                if (!StringUtils.hasText(idCardFrontPhoto))
//                    continue;
//                BaseDto baseDto = userRealInfoService.verifyIdCardPhoto(idCardFrontPhoto, true, userRealInfo);
//                if (baseDto.getCode() == CodeConst.ERROR)
//                {
////                ossCommonService.deleteFile(bucketName,idCardFrontPhoto);
//                    continue;
//                }
//
//                /** 验证背面照 **/
//                String idCardBackPhoto = userRealInfo.getIdCardBackPhoto();
//                if (!StringUtils.hasText(idCardBackPhoto))
//                    continue;
//                baseDto = userRealInfoService.verifyIdCardPhoto(idCardBackPhoto, false, userRealInfo);
//                if (baseDto != null && baseDto.getCode() == CodeConst.ERROR)
//                {
////                ossCommonService.deleteFile(bucketName,idCardBackPhoto);
//                    continue;
//                }
//
//                if (baseDto == null || !baseDto.isError())
//                {
//                    userRealInfo.setVerified(1);
//                    userRealInfoService.update(userRealInfo);
//                }
//            }
//        }
//    }
//
//}
